<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 	<title>${title }</title>
	<!--自定义index样式-->
	<link rel="stylesheet" href="${ctx }/static/styles/basic/basic.css" />
	<link rel="stylesheet" href="${ctx }/static/styles/edit/box.css" />
	<!--js库-->
	<%@ include file="/static/commons/jquery-easyui.jsp" %>
	<script language="JavaScript" src="${ctx}/static/widgets/easyui/plugins/jquery.draggable.js"></script>
	<script language="JavaScript" src="${ctx}/static/widgets/easyui/plugins/jquery.droppable.js"></script>
	<script language="JavaScript" src="${ctx}/static/widgets/easyui/plugins/jquery.tree.js"></script>
	<script language="JavaScript" src="${ctx}/static/scripts/set_select.js"></script>
	<script language="JavaScript" src="${ctx}/static/scripts/common.js"></script>
	<script language="javascript"src="${ctx}/static/scripts/WdatePicker/WdatePicker.js"></script>
	<style>
		.message {
		    width: 80px;
		    background: rgb(241, 241, 241);
		    text-align: right;
		    padding-right: 5px;
		}
		.equDiv .message {
		    width: 80px;
		    background: rgb(241, 241, 241);
		    text-align: center;
		    padding: 5px;
		}
		#equTable tr td:FIRST-CHILD{
			padding: 0px;
			width: 30px;
			text-align: center;
		}
	</style>
  </head>
  
  <body style="padding-bottom:8px;">
  		<c:set var="em" value="<span>*</span>"></c:set>
  		<c:set var="disabled" value=""></c:set>
  		<c:set var="ifSelect" value=""></c:set>
  		<c:set var="noChange" value=""></c:set>
  		<c:set var="isImportant" value="true"></c:set>
  		<c:if test="${not empty view}">
  			<c:set var="disabled" value="disabled"></c:set>
  			<c:set var="ifSelect" value="false"></c:set>
  			<c:set var="em" value=""></c:set>
  			<c:set var="isImportant" value=""></c:set>
  		</c:if>
  		<c:if test="${not empty role.user_id}">
	  		<c:set var="noChange" value="disabled"></c:set>
  		</c:if>
  		<form id="editForm" action="${ctx}/buyApply/save" method="post">
  			<input type="hidden" value="${obj.buy_id}" id="buyId" name="p_buyId" />
  			<input type="hidden" value="${auditType}" id="auditType" name="p_auditType" />
  			<div class="box">
  				<div>
  					<label style="font-size: 16px;font-weight: 700;">采购申请单</label>
  				</div>
  				<div>
  					<label style="float: right;">
  						序号：${not empty obj.buy_id?obj.log_code:'系统自动生成'}
  					</label>
  					<label style="float: right;margin-right: 15px;">
  						编号：${not empty obj.buy_id?obj.buy_code:'系统自动生成'}
					</label>
  				</div>
	  			<table cellspacing="0" cellpadding="0">
					<tbody>
						<tr>
							<td class="message">
								<p>用途：</p>
							</td>
							<td><vvise:select id="buyUse" name="p_buyUse"
									sqlname="getCodeData" className="wd170" width="99%"
									sqlparam="use_to" ifSelect="false" defval="${obj.buy_use }"
									onchange="showCust(this.value)" /></td>
							<td class="message">
								<p>申请人：</p>
							</td>
							<td>${obj.buy_user_name}</td>
							<td class="message">
								<p>申请时间：</p>
							</td>
							<td colspan="3"><fmt:formatDate value="${obj.req_date }"
									pattern="yyyy-MM-dd HH:mm:ss" /></td>
						</tr>
						<tr>
							<td class="message">
								<p>供应商名称：</p>
							</td>
							<td style="width: 143px">${obj.supplier }</td>
							<td class="message">
								<p>供应商地址：</p>
							</td>
							<td style="width: 143px">${obj.supplier_addr }</td>
							<td class="message">
								<p>联系人：</p>
							</td>
							<td style="width: 143px">${obj.supplier_linkman }</td>
							<td class="message">
								<p>联系电话：</p>
							</td>
							<td style="width: 143px">${obj.supplier_phone }</td>
						</tr>
						<tr>
							<td class="message">
								<p>到货日期：</p>
							</td>
							<td><fmt:formatDate value="${obj.arrive_date }"
									pattern="yyyy-MM-dd" /></td>
							<td class="message">
								<p>申请理由：</p>
							</td>
							<td colspan="5">${obj.apply_reason }</td>
						</tr>
						<c:if test="${obj.buy_use eq 2}">
							<tr id="custTr">
								<td class="message">
									<p>客户单位：</p>
								</td>
								<td>${obj.customer }</td>
								<td class="message">
									<p>客户地址：</p>
								</td>
								<td>${obj.cust_addr }</td>
								<td class="message">
									<p>联系人：</p>
								</td>
								<td>${obj.cust_linkman }</td>
								<td class="message">
									<p>联系电话：</p>
								</td>
								<td>${obj.cust_phone }</td>
							</tr>
						</c:if>
					</tbody>
				</table>
	  			<div class="equDiv" style="margin-bottom: -1px; margin-top: -1px;">
		  			<table cellspacing="0" cellpadding="0">
		  				<tbody id="equTable">
							<tr>
								<td class="message">
									<p>序号</p>
								</td>
								<td class="message">
									<p>采购产品名称</p>
								</td>
								<td class="message">
									<p>型号</p>
								</td>
								<td class="message">
									<p>数量</p>
								</td>
								<td class="message">
									<p>单价</p>
								</td>
								<td class="message">
									<p>总价</p>
								</td>
							</tr>
							<c:forEach items="${details}" var="v" varStatus="i">
								<tr id="tr_${i.count }" class="proClass" idx="${i.count }">
									<td>
										<label id="xuhao_${i.count }" style="font-weight: 700;text-align: center;">${i.count }</label>
									</td>
									<td>
										<input type="text" id="productName_${i.count }" name="productName" value="${v.product_name }"
											class="wd170 " disabled maxlength="32" style="width: 100%;" />
									</td>
									<td>
										<input type="text" id="model_${i.count }" name="model" value="${v.model }"
											class="wd170 " disabled maxlength="32" style="width: 100%;" />
									</td>
									<td>
										<input type="text" id="num_${i.count }" name="num" onkeyup="getTotal(${i.count })" value="${v.num }"
											class="wd170 " disabled maxlength="32" style="width: 100%;" />
									</td>
									<td>
										<input type="text" id="unitPrice_${i.count }" name="unitPrice"  onkeyup="getTotal(${i.count })" value="${v.unit_price }"
											class="wd170 " disabled maxlength="64" style="width: 100%;" />
									</td>
									<td>
										<label id="total_${i.count }">${v.num * v.unit_price }</label>
									</td>
								</tr>
							</c:forEach>
						</tbody>
		  			</table>
	  			</div>
	  			<div style="">
	  					<table cellspacing="0" cellpadding="0">
		  					<tbody>
		  						<tr>
		  							<td class="message">
										<p>主管：</p>
									</td>
									<td>
										<input type="text" value="${obj.director_name }"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
									<td class="message">
										<p>审核时间：</p>
									</td>
									<td>
										<input type="text" value="<fmt:formatDate value="${obj.director_date}" pattern="yyyy-MM-dd HH:mm:ss" />"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
		  						</tr>
		  						<tr>
		  							<td class="message">
										<p>经理：</p>
									</td>
									<td>
										<input type="text"  value="${obj.manager_name }"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
									<td class="message">
										<p>审核时间：</p>
									</td>
									<td>
										<input type="text" value="<fmt:formatDate value="${obj.manager_date}" pattern="yyyy-MM-dd HH:mm:ss" />"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
		  						</tr>
		  						<tr>
		  							<td class="message">
										<p>付款人：</p>
									</td>
									<td>
										<input type="text"  value="${obj.pay_user_name }"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
									<td class="message">
										<p>付款时间：</p>
									</td>
									<td>
										<input type="text" value="<fmt:formatDate value="${obj.pay_date}" pattern="yyyy-MM-dd HH:mm:ss" />"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
		  						</tr>
		  						<tr>
		  							<td class="message">
										<p>回票方式：</p>
									</td>
									<td>
										<input type="text" value="${obj.back_bill_type_name }"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
									<td class="message">
										<p>回票人：</p>
									</td>
									<td>
										<input type="text" value="${obj.back_bill_user_name}"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
		  						</tr>
		  						<tr>
		  							<td class="message">
										<p>回票时间：</p>
									</td>
									<td>
										<input type="text"  value="<fmt:formatDate value="${obj.back_bill_date}" pattern="yyyy-MM-dd HH:mm:ss" />"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
									<td class="message">
										<p>回票备注：</p>
									</td>
									<td>
										<input type="text" value="${obj.back_bill_remark }"
											class="wd170 " disabled maxLength="20" style="width: 100%;" />
									</td>
		  						</tr>
		  					</tbody>
		  				</table>
	  			</div>
	  		</div>
        </form>
  </body>
</html>